package org.nstack.header.cluster;

import org.nstack.header.message.APIDeleteMessage;
import org.nstack.header.message.APIEvent;
import org.nstack.header.message.APIMessage;
import org.nstack.header.message.APIParam;
import org.springframework.http.HttpMethod;
import org.nstack.header.notification.ApiNotification;
import org.nstack.header.rest.RestRequest;


@RestRequest(
        path = "/clusters/{uuid}",
        method = HttpMethod.DELETE,
        responseClass = APIDeleteClusterEvent.class
)
public class APIDeleteClusterMsg extends APIDeleteMessage implements ClusterMessage {

    @APIParam
    private String uuid;

    public APIDeleteClusterMsg() {
    }

    public APIDeleteClusterMsg(String clusterUuid) {
        this.uuid = clusterUuid;
    }

    public void setUuid(String clusterUuid) {
        this.uuid = clusterUuid;
    }

    public String getUuid() {
        return uuid;
    }

    @Override
    public String getClusterUuid() {
        return getUuid();
    }
 
    public static APIDeleteClusterMsg __example__() {
        APIDeleteClusterMsg msg = new APIDeleteClusterMsg();
        msg.setUuid(uuid());
        return msg;
    }

    public ApiNotification __notification__() {
        APIMessage that = this;

        return new ApiNotification() {
            @Override
            public void after(APIEvent evt) {
                ntfy("Deleted").resource(uuid, ClusterVO.class.getSimpleName())
                        .messageAndEvent(that, evt).done();
            }
        };
    }

}
